
 /*
   路由模块 
 */
 import Vue from 'vue'
 import VueRouter from 'vue-router'
 // 引入路由组件文件夹下的组件
 import Msite from '../pages/Msite/Msite.vue'
 import Search from '../pages/Search/Search.vue'
 import Order from '../pages/Order/Order.vue'
 import Profile from '../pages/Profile/Profile.vue'
 import Login from '../pages/Login/Login.vue'
 import Shop from '../pages/Shop/Shop.vue'
 import ShopInfo from '../pages/Shop/ShopInfo/ShopInfo.vue'
 import ShopGoods from '../pages/Shop/ShopGoods/ShopGoods.vue'
 import ShopRating from '../pages/Shop/ShopRating/ShopRating.vue'
 //路由懒加载
 //const Msite =() =>  import('../pages/Msite/Msite.vue')
 
 // 全局注册Vue-router组件
 Vue.use(VueRouter)
 
 // 配置路由表并导出
 export default new VueRouter({
   //去掉地址中的哈希#
   mode: 'history',
   routes: [{
       path: '/',
       redirect: '/msite'
     },
     {
       path: '/msite',
       component: Msite,//返回函数 加载路由路径 	 请求数据后才会执行
       meta:{
       	showFooter:true
       }
     },
     {
     	  path: '/login',
       component:Login,
         meta:{
       	showFooter:false
       }
     },
     {
       path: '/search',
       component: Search,
         meta:{
       	showFooter:true
       }
     },
     {
       path: '/order',
       component: Order,
         meta:{
       	showFooter:true
       }
     },
     {
       path: '/profile',
       component: Profile,
         meta:{
       	showFooter:true
       }
     },
      {

      path: '/shop',
      component: Shop,
      children: [{
        path: '/shop/goods',
        component: ShopGoods,
          meta:{
       	showFooter:false
       }
      },
      {
        path: '/shop/ratings',
        component: ShopRating
      },
      {
        path: '/shop/info',
        component: ShopInfo
      },
      {
        path: '',
        redirect: '/shop/goods'
      }]
      }
      ]
 })
